package com.rt.easyjava.base.biz1.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rt.easyjava.base.biz1.bean.TmptAuthUserBiz;
import com.rt.easyjava.base.biz1.mapper.base.TmptAuthUserMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *  Mapper 接口
 * @author wuxiaoyong
 * @since 2020-06-13
 */

@Mapper
public interface TmptAuthUserBizMapper extends TmptAuthUserMapper {

    IPage<TmptAuthUserBiz> myPageHasRolesNoPsd(Page<TmptAuthUserBiz> page, @Param(Constants.WRAPPER) Wrapper<TmptAuthUserBiz> wrapper);

    @Select("select t1.*,t2.name as tmptAuthDeptName, t3.name as tmptAuthDeptPostName from tmpt_auth_user t1 " +
            "left join tmpt_auth_dept t2 on t1.tmpt_auth_dept_id=t2.id " +
            "left join tmpt_auth_dept t3 on t1.tmpt_auth_dept_post_id=t3.id ${ew.customSqlSegment}")
    List<TmptAuthUserBiz> myList(@Param(Constants.WRAPPER) Wrapper<TmptAuthUserBiz> wrapper);

}
